#!/bin/bash
#
# see available options:
# http://peter.sh/experiments/chromium-command-line-switches/
#
# 8080 - is a standard port for Burp

# To disable XSS Auditor in Chromium simply put 0 as second argument, 1 leaves XSS Auditor enabled
# to enable auto opening DevTools, set 1 as a third argument

echo
echo "Usage: chromium [port] [enable xss Auditor] [open DevTools for new tabs]"
echo " example:"
echo " $ chromium 8080 1 1 - runs Chromium listening on 8080, XSS Auditor enabled and DevTools open in new tab(s)"

# default settings
xss_auditor=""
port=""
devtools=""

if [ $1 -ne 80 ]; then
	port="--proxy-server=127.0.0.1:$1"
fi

if [ $2 == 0 ]; then
	xss_auditor="--disable-xss-auditor"
fi

if [ $3 == 1 ]; then
	devtools="--auto-open-devtools-for-tabs"
fi

# update those lines to your system specific path:
cd /Applications/Chromium.app/Contents/MacOS
echo "[+] running ./Chromium $port $xss_auditor $devtools"

./Chromium $port $xss_auditor $devtools 
